/*

*** This do file creates the replication results for 

Strategic Delaying and Concessions Extraction in Accession Negotiations to the World Trade Organization, World Trade Review, 12 (4), 2013, pp. 669-692

Eric Neumayer (LSE)																			

Please report any errors to e.neumayer@lse.ac.uk

*/



***********************************************************************************
local DIR = "C:\Research\GDP and Trade\WTO\"  /*change relative path to the directory where the files are located */
cd "`DIR'"
***********************************************************************************

use "Article for WTR", clear

* Including US, Canada, EU, Japan & Australia
logit  wpmembership  pta_dummy#c.lnbilat_trade_togdpmember_zerof i.pta_dummy exp_market_prod_sim gdpconst_shareglobal_b lngdpconst2000usd_member lngdppcconst_member lntrade_member   lngdpconst2000usd_applicant lngdppcconst2000usd_applicant lntrade_applicant contiguity4dummy    accessionyear    i.year if  wp_est_year!=. & year>= accessionyear, robust cluster( member)
estat classification

* Excluding US, Canada, EU, Japan & Australia
logit  wpmembership  pta_dummy#c.lnbilat_trade_togdpmember_zerof i.pta_dummy exp_market_prod_sim gdpconst_shareglobal_b lngdpconst2000usd_member lngdppcconst_member lntrade_member   lngdpconst2000usd_applicant lngdppcconst2000usd_applicant lntrade_applicant contiguity4dummy    accessionyear    i.year if  wp_est_year!=. & year>= accessionyear & EUmember==0 & member!="United States" & member!="Canada" & member!="Japan" & member!="Australia", robust cluster( member)
estat classification

su wpmembership  lnbilat_trade_togdpmember_zerof pta_dummy      exp_market_prod_sim  gdpconst_shareglobal_b lngdpconst2000usd_member lngdppcconst_member lntrade_member   lngdpconst2000usd_applicant lngdppcconst2000usd_applicant lntrade_applicant contiguity4dummy    accessionyear if  e(sample)

* Graph for lnbilat_trade_togdpmember_zerof (for dyads that do not share PTA)  
label var lnbilat_trade_togdpmember_zerof "Bilateral trade as share of member GDP (in logs)"
quietly logit  wpmembership           gdpconst_shareglobal_b     exp_market_prod_sim    i.pta_dummy pta_dummy#c.lnbilat_trade_togdpmember_zerof lngdpconst2000usd_member lngdppcconst_member lntrade_member   lngdpconst2000usd_applicant lngdppcconst2000usd_applicant lntrade_applicant contiguity4dummy    accessionyear    i.year if  wp_est_year!=. & year>= accessionyear & EUmember==0 & member!="United States" & member!="Canada" & member!="Japan" & member!="Australia", robust cluster( member)
margins,  at(lnbilat_trade_togdpmember_zerof=(-31 (4) -15) pta_dum=(0)) atmeans post level(90)
marginsplot, title("Probability of Working Party Membership") ytitle("")  recastci(rline)
graph export  bilat_trade.eps, replace

* Graph for exp_market_prod_sim
quietly logit  wpmembership  pta_dummy#c.lnbilat_trade_togdpmember_zerof i.pta_dummy exp_market_prod_sim gdpconst_shareglobal_b lngdpconst2000usd_member lngdppcconst_member lntrade_member   lngdpconst2000usd_applicant lngdppcconst2000usd_applicant lntrade_applicant contiguity4dummy    accessionyear    i.year if  wp_est_year!=. & year>= accessionyear & EUmember==0 & member!="United States" & member!="Canada" & member!="Japan" & member!="Australia", robust cluster( member)
label var exp_market_prod_sim "Structural Export Similarity"
margins,  at(exp_market_prod_sim=(0 (.1) .7)) atmeans post level(90)
marginsplot, title("Probability of Working Party Membership") ytitle("")  recastci(rline)
graph export  export_market_prod_sim.eps, replace

* Graph for econ_size_common_pta  
quietly logit  wpmembership  pta_dummy#c.lnbilat_trade_togdpmember_zerof i.pta_dummy exp_market_prod_sim gdpconst_shareglobal_b lngdpconst2000usd_member lngdppcconst_member lntrade_member   lngdpconst2000usd_applicant lngdppcconst2000usd_applicant lntrade_applicant contiguity4dummy    accessionyear    i.year if  wp_est_year!=. & year>= accessionyear & EUmember==0 & member!="United States" & member!="Canada" & member!="Japan" & member!="Australia", robust cluster( member)
label var gdpconst_shareglobal_b "Size of common PTAs as share of world economy"
quietly logit  wpmembership           gdpconst_shareglobal_b     exp_market_prod_sim    i.pta_dummy pta_dummy#c.lnbilat_trade_togdpmember_zerof lngdpconst2000usd_member lngdppcconst_member lntrade_member   lngdpconst2000usd_applicant lngdppcconst2000usd_applicant lntrade_applicant contiguity4dummy    accessionyear    i.year if  wp_est_year!=. & year>= accessionyear & EUmember==0 & member!="United States" & member!="Canada" & member!="Japan" & member!="Australia", robust cluster( member)
margins,  at(gdpconst_shareglobal_b=(0 (.03).15)) atmeans post level(90)
marginsplot, title("Probability of Working Party Membership") ytitle("")  recastci(rline)
graph export  econ_size_common_pta.eps, replace

